]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
workspace: Don't unfreeze layout during overview animation
authorIvan Molodetskikh <yalterz@gmail.com>
Sun, 27 Dec 2020 17:39:22 +0000 (20:39 +0300)
committerMarge Bot <marge-bot@gnome.org>
Wed, 13 Jan 2021 21:40:22 +0000 (21:40 +0000)
During overview closing animation the allocation expands more or less
every frame. Unfreezing the layout then leads to windows snapping to
their new position if e.g. a window was closed which doesn't look nice.

Fixes https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/3216

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1550>

js/ui/workspace.js

index 74d23840bcfb95719f9ef52cb338675b10dd27d6..de1ce2d316823b5acf04b68ee0f4b307d58aa626 100644 (file)
@@ -566,8 +566,13 @@ var WorkspaceLayout = GObject.registerClass({
         this._lastBox = containerBox.copy();
 
         // If the containers size changed, we can no longer keep around
-        // the old windowSlots, so we must unfreeze the layout
-        if (this._layoutFrozen && containerAllocationChanged) {
+        // the old windowSlots, so we must unfreeze the layout.
+        //
+        // However, if the overview animation is in progress, don't unfreeze
+        // the layout. This is needed to prevent windows "snapping" to their
+        // new positions during the overview closing animation when the
+        // allocation subtly expands every frame.
+        if (this._layoutFrozen && containerAllocationChanged && !Main.overview.animationInProgress) {
             this._layoutFrozen = false;
             this.notify('layout-frozen');
         }